package com.xingchen.springboot3.common.bean;

import lombok.Data;

/**
 *
 * @author weijingchen
 * @DateTime 2025-09-26
 */
@Data
public class Base {
    private Integer pageNum = 1;
    private Integer pageSize = 10;

    public void setPageNum(Integer pageNum) {
        this.pageNum = (pageNum != null && pageNum > 0) ? pageNum : 1;

    }

    public void setPageSize(Integer pageSize) {
        if (pageSize == null) {
            this.pageSize = 10;
        } else if (pageSize <= 0) {
            this.pageSize = 10;
        } else if (pageSize > 1000) {
            this.pageSize = 1000;
        } else {
            this.pageSize = pageSize;
        }
    }
}